package cn.explink.dop.gis;

import net.sf.json.JSONObject;

/**
 * 坐标位置点
 *
 * @author Administrator
 *
 */
public class Point {
	private String id;

	private double lng;

	private double lat;

	public Point() {
		super();
	}

	public Point(String id, double lng, double lat) {
		super();
		this.id = id;
		this.lng = lng;
		this.lat = lat;
	}

	/**
	 * 构造函数
	 *
	 * @param point
	 *            point格式 ： {"lng":116.478513,"lat":39.916465} json字符串
	 */
	public Point(String point) {
		try {
			JSONObject jsonPoint = JSONObject.fromObject(point);
			this.lng = jsonPoint.getDouble("lng");
			this.lat = jsonPoint.getDouble("lat");
		} catch (Exception e) {
			this.lng = 0;
			this.lat = 0;
		}

	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public double getLng() {
		return this.lng;
	}

	public void setLng(double lng) {
		this.lng = lng;
	}

	public double getLat() {
		return this.lat;
	}

	public void setLat(double lat) {
		this.lat = lat;
	}

}